/*
 * @ : Copyright (c) 2021 Phytium Information Technology, Inc. 
 *  
 * SPDX-License-Identifier: Apache-2.0.
 * 
 * @Date: 2021-09-14 10:48:07
 * @LastEditTime: 2021-09-15 18:24:32
 * @Description:  This files is for sdmmc static init implementation
 * 
 * @Modify History: 
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 * 1.0   Zhugengyu   2021/8/6    init
 */
#include "f_sdmmc.h"
#include "parameters.h"

extern const FSdmmcConfig sdmmc_cfg_tbl[FSDMMC_HOST_INSTANCE_NUM];

const FSdmmcConfig *FSdmmcLookupConfig(u32 instance_id)
{
    const FSdmmcConfig *config_p = NULL;
    u32 index;

    for (index = 0; index < (u32)FSDMMC_HOST_INSTANCE_NUM; index++)
    {
        if (sdmmc_cfg_tbl[index].instance_id == instance_id)
        {
            config_p = &sdmmc_cfg_tbl[index];
            break;
        }
    }

    return (const FSdmmcConfig *)config_p;  
}